package demo;

import java.util.ResourceBundle;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class MessageFactory {

	public static FacesMessage getMessage(String bundle, FacesContext ctx, String key) {
        return new FacesMessage(ResourceBundle.getBundle(bundle, ctx.getCurrentInstance().getViewRoot().getLocale()).getString(key));
	}

}
